home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6907 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: nntp.hut.fi!usenet
  2. From: oahvenla@hyppynaru.cs.hut.fi (Osma Ahvenlampi)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Messages vs. Semaphores for external clocking
  5. Date: 04 Apr 1996 19:30:04 +0300
  6. Organization: What, me, organised?
  7. Sender: oahvenla@hyppynaru.cs.hut.fi
  8. Distribution: inet
  9. Message-ID: <jdj7mvw6jg3.fsf@hyppynaru.cs.hut.fi>
  10. References: <4ju349$r1e@sparky.navsea.navy.mil>
  11. NNTP-Posting-Host: hyppynaru.cs.hut.fi
  12. Mime-Version: 1.0
  13. Content-Type: text/plain; charset=US-ASCII
  14. In-reply-to: matuli_a@marlin.navsea.navy.mil's message of 3 Apr 1996 14:48:41
  15.     GMT
  16. X-Newsreader: Gnus v5.1
  17.  
  18. In article <4ju349$r1e@sparky.navsea.navy.mil> matuli_a@marlin.navsea.navy.mil (Alex Matulich 03T1 602-6691) writes:
  19. >I am wondering what is the most efficient way for one task to make data
  20. >available to another task.  I can do this by passing messages, or by
  21. >setting up a semaphore to provide a common area of memory accessible by
  22. >both tasks.
  23.  
  24. For Exec, both methods are very fast. Just try it yourself, make a
  25. loop that sends messages between two tasks, and on the other hand try
  26. looping on ObtainSemaphore()/ReleaseSemaphore().
  27.  
  28. So, the choice of which to use shouldn't be a question of
  29. performance. Choose whichever suits your problem better. In your
  30. specific case, it would seem that using a semaphore protected, perhaps
  31. double buffered shared data region and signaling the other task every
  32. time new data is available might work well. You can set up semaphores
  33. to even do the signaling.
  34.  
  35. -- 
  36. Wynne`s Law: Negative slack tends to increase.
  37. | "Osma Ahvenlampi" <mailto:oa@iki.fi> <http://www.iki.fi/oa/> |
  38. | Amiga&BeBox&ClassAct&Voodoo&ARTech cool stuff: I-Net225&AWeb |
  39.                                                               --
  40.